package me.itxuye.moment.ui.activity;

import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import butterknife.Bind;
import me.itxuye.moment.R;
import me.itxuye.moment.base.BaseFullScreenActivity;

//@formatter:off
public class SplashActivity extends BaseFullScreenActivity {

  @Bind(R.id.splash_image)
  ImageView splash_image;


  //@formatter:on
  @Override protected int provideContentViewId() {

    return R.layout.activity_splash;
  }

  @Override protected void initView() {

    initAnimation();
  }

  private void initAnimation() {

    Animation animation = AnimationUtils.loadAnimation(this, R.anim.splash);
    animation.setAnimationListener(new Animation.AnimationListener() {
      @Override public void onAnimationStart(Animation animation) {

      }

      @Override public void onAnimationEnd(Animation animation) {
        SplashActivity.this.readyGoThenKill(MainActivity.class);
      }

      @Override public void onAnimationRepeat(Animation animation) {

      }
    });

    splash_image.startAnimation(animation);
  }

  @Override protected void setListener() {

  }

  @Override protected void initData() {

  }

  @Override protected void getIntentData(Bundle saveInstance) {

  }

  @Override public void onClick(View v) {

  }
}
